﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoolCode.Web.UI;
using CoolCode.Services;

namespace CoolCode.Web.UI.Views.Home 
{
    public partial class Login : System.Web.UI.Page
    {
        private ITrackService _TrackService;
        public ITrackService TrackService
        {
            get
            {
                if (_TrackService == null)
                {
                    _TrackService = ServiceFactory.Produce<ITrackService>();
                }
                return _TrackService;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            //lblSystem.Text = Config.CompanyName ;
            lblSubHead.Text = Config.CompanyName ;
            //login.TitleText = Config.CompanyName ;
            //login.CreateUserText = "注册";
            //login.CreateUserUrl = this.Url<Regedit>();
             login.DestinationPageUrl = "~";
            //login.PasswordRecoveryText = "忘记密码？";
            //login.PasswordRecoveryUrl = this.Url<RecoverPassword>();
             login.LoggedIn += new EventHandler(login_LoggedIn);
        }

        protected  void login_LoggedIn(object sender, EventArgs e)
        {
            this.TrackService.LogAndSubmit(this.BuildLog(UserAction.Access, login.UserName + " Login"));
        }
    }
}
